
var option = {
    tooltip: {
        formatter: "{a} <br/>{c} {b}"
    },
    series: [
        {
            type: 'gauge',
            z: 3,
            min: 0,
            max: 80,
            splitNumber: 8,
            radius: '100%',
            axisLine: {            // 坐标轴线
                lineStyle: {       // 属性lineStyle控制线条样式
                    width: 3,
                    color: [[0.125, '#40c765'], [0.7, '#0e6fec'], [1, '#ac3b35']]
                }
            },
            axisTick: {            // 坐标轴小标记
                length: 5,        // 属性length控制线长
                lineStyle: {       // 属性lineStyle控制线条样式
                    color: 'auto'
                }
            },
            splitLine: {           // 分隔线
                length: 10,         // 属性length控制线长
                lineStyle: {       // 属性lineStyle（详见lineStyle）控制线条样式
                    color: '#fff'
                }
            },
            axisLabel: {
                backgroundColor: '#000',
                borderRadius: 2,
                color: '#eee',
                padding: 3,
                textShadowBlur: 2,
                textShadowOffsetX: 1,
                textShadowOffsetY: 1,
                textShadowColor: '#222'
            },
            title: {
                // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                fontWeight: 'bolder',
                fontSize: 20,
                fontStyle: 'italic'
            },
            detail: {
                fontWeight: 'bolder',
                borderRadius: 3,
                backgroundColor: '#000',
                borderColor: '#aaa',
                shadowBlur: 5,
                shadowColor: '#333',
                shadowOffsetX: 0,
                shadowOffsetY: 3,
                borderWidth: 0,
                textBorderColor: '#000',
                textBorderWidth: 2,
                textShadowBlur: 2,
                textShadowColor: '#fff',
                textShadowOffsetX: 0,
                textShadowOffsetY: 0,
                fontFamily: 'Arial',
                width: 20,
                color: '#eee',
                rich: {}
            },
            data: [{value: 40, name: ''}]
        },
    ]
};
    var temoption = $.extend(true,{}, option);
    var yaoption = $.extend(true,{}, option);
    temoption.series[0].max = 100;
    yaoption.series[0].max = 150;
function set() {
    $.ajax({
        url: 'http://hb.hbjc2018.cn/hbjc/getEnvInfo?key='+ key,
        success: function(res){
            option.series[0].data[0].value = res.temp; //温度
            temoption.series[0].data[0].value = res.humi; //湿度
            yaoption.series[0].data[0].value = res.pressure;
            var myChart = echarts.init(document.getElementById('main11'));
            var temChart = echarts.init(document.getElementById('main12'));
            var yaChart1 = echarts.init(document.getElementById('main13'));
            myChart.setOption(option);
            temChart.setOption(temoption);
            yaChart1.setOption(yaoption);
        },
        error:function(data) {
            console.log(data);
        }
    });


}


   